package org.binglan.youziyuepai.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.binglan.youziyuepai.enums.ResponseEnum;

/**
 * @description:
 * @author: sanjin
 * @date: 2019/4/2 20:39
 */
@Data
@NoArgsConstructor
@ApiModel(description = "响应数据格式")
public class ResponseVo {
    @ApiModelProperty(value = "业务错误代码(1 调用成功)")
    private int code;

    @ApiModelProperty(value = "错误详细信息")
    private String message;

    @ApiModelProperty(value = "数据")
    private Object data;

    public ResponseVo(ResponseEnum responseEnum) {
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMessage();
    }
}
